package com.yi.wood.base;

/**
 * @author moyi
 * @since 1.0
 */
public enum ResultCodeEnum {

    /**
     * 成功返回
     */
    SUCCESS("200","ok"),
    /**
     * 未知异常
     */
    UNKNOW_EXCEPTION("500","unkown exception"),
    /**
     * 未找到数据
     */
    NOT_FOUND("501","not found data"),
    /**
     * 缺少参数
     */
    MISS_PARAMETER("502","parameter missing"),
    /**
     * 参数错误
     */
    ERROR_PARAMETER("503","参数错误"),
    /**
     * 系统异常
     */
    SYSTEM_EXCEPTION("504","system exception"),
    /**
     * 数据已经存在
     */
    DATA_ALREADY_EXISTS("505","data already exists"),
    /**
     * 没有token，不能访问
     */
    NO_TOKEN("506","no access permission"),
    /**
     * 验证码过期
     */
    VER_EXPIRE("507","verification code expired"),
    /**
     * 认证失败
     */
    AUTH_FAILED("508","认证失败"),
    /**
     * 认证过期
     */
    AUTH_EXPIRE("509", "token is expire"),

    ORDER_ERROR("510","订单异常"),

    BUSINESS_FAILED("511","业务处理异常"),
    /**
     * 删除记录时，存在引用关系不能删除
     */
    CANNOT_DELETE("512","不能删除");
    ;

    private String code;

    private String msg;

    ResultCodeEnum(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }


    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
